<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\Db;
use think\Config;

class Colorful extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = 'default';


    public function _initialize()
    {
        parent::_initialize();

        $banner = Db::name('banner')->where([
            'lanmu' => 'colorful'
        ])->select();
        $this->assign('banner', $banner);
    }

    //年度代表色
    public function index()
    {
        $colorful = Db::name('colorful')->order('weigh desc,id desc')->select();
        $this->assign('colorful', $colorful);
        return $this->view->fetch();
    }

    //色彩与风格
    public function style()
    {
        $this->assign('style_content',Config::get('site.color_style_content'));
        return $this->view->fetch();
    }

    //色彩与性格
    public function personality()
    {
        $personality = Db::name('personality')->order('weigh desc,id desc')->select();
        $this->assign('personality',$personality);
        return $this->view->fetch();
    }

}
